Skip to content

fix(Session): send SameSite attribute in BaseHandler::destroyCookie() - #10748

Merged
paulbalandan merged 1 commit into
codeigniter4:developfrom
gr8man:fix/session-base-handler-cookie-samesite
Nov 13, 2026
Merged

paulbalandan merged 1 commit into
codeigniter4:developfrom
gr8man:fix/session-base-handler-cookie-samesite

Conversation

@gr8man

@gr8man gr8man commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Description
BaseHandler::destroyCookie() did not include the SameSite attribute in the $options array passed to setcookie(), while Session::configure() and Session::setCookie() set it according to Config\Cookie::$samesite. This change stores $cookieSameSite from Config\Cookie and passes it when destroying the cookie, defaulting empty values to Lax.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value (without duplication)
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@carson-codeigniter4 carson-codeigniter4 Bot added the bug Verified issues on the current code behavior or pull requests that will fix them label Nov 8, 2026
@gr8man
gr8man force-pushed the fix/session-base-handler-cookie-samesite branch from 4e28581 to 80096f4 Compare November 8, 2026 22:54
Comment thread system/Session/Handlers/BaseHandler.php Resolved
@gr8man
gr8man force-pushed the fix/session-base-handler-cookie-samesite branch from 80096f4 to ebb4547 Compare November 12, 2026 10:40
@gr8man
gr8man force-pushed the fix/session-base-handler-cookie-samesite branch from ebb4547 to f892103 Compare November 12, 2026 13:43
@gr8man
gr8man requested a review from michalsn November 12, 2026 13:57

@michalsn michalsn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@paulbalandan
paulbalandan merged commit 9b8ecca into codeigniter4:develop Nov 13, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Verified issues on the current code behavior or pull requests that will fix them

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants